namespace Example.Web
{
    using SimpleWebServices;
    using SimpleWebServices.Web.UI.Html.Elements;
    using Xunit;

    public sealed class AsterixSpanFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(new ObjectExpectations<AsterixSpan>()
                .DerivesFrom<Span>()
                .IsConcreteClass()
                .IsSealed()
                .HasDefaultConstructor()
                .XmlRoot("span")
                .Result);
        }

        [Fact]
        public void deserialize()
        {
            AsterixSpan expected = new AsterixSpan();
            AsterixSpan actual = "<span type='asterix' />".Deserialize<AsterixSpan>();

            Assert.Equal<string>(expected.ToString(), actual.ToString());
        }

        [Fact]
        public void serialize()
        {
            Assert.True((bool)new AsterixSpan().Serialize().CreateNavigator().Evaluate("1=count(/span[@class='error'][text()='* '])"));
        }

        [Fact]
        public void ctor()
        {
            Assert.NotNull(new AsterixSpan());
        }

        [Fact]
        public void op_Deserialize_string_string_string()
        {
            AsterixSpan expected = new AsterixSpan();
            AsterixSpan actual = new AsterixSpan().Deserialize("span", "asterix", null) as AsterixSpan;

            Assert.Equal<string>(expected.ToString(), actual.ToString());
        }
    }
}